package com.atguigu.client;

import com.alibaba.fastjson.JSONObject;
import com.atguigu.entity.*;
import com.atguigu.fallback.ProductFallback;
import com.atguigu.result.RetVal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@FeignClient(value = "shop-product",fallback = ProductFallback.class)
public interface ProductFeignClient {

    //根据skuid查询skuInfo信息
    @GetMapping("/sku/getSkuInfo/{skuId}")
    public SkuInfo getSkuInfo(@PathVariable Long skuId);
    //根据productId skuId 获取所有spu商品属性对应的某个sku的商品销售属性  在前端默认为勾选状态
    @GetMapping("/sku/getSpuSaleProperty/{productId}/{skuId}")
    public List<ProductSalePropertyKey> getSpuSaleProperty(@PathVariable Long productId,
                                                           @PathVariable Long skuId);
    //根据skuId查询商品实时价格
    @GetMapping("/sku/getSkuPrice/{skuId}")
    public BigDecimal getSkuPrice(@PathVariable Long skuId);
    //根据skuId查询分类信息
    @GetMapping("/sku/getCategoryView/{category3Id}")
    public BaseCategoryView getCategoryView(@PathVariable Long category3Id);
    //通过spuId查询spu的商品属性 与 skuId获取对应的商品属性 的关系
    @GetMapping("/sku/getSkuSalePropertyValueId/{productId}")
    public Map getSkuSalePropertyValueId(@PathVariable Long productId);
    //获取商品首页的分类信息
    @GetMapping("/product/getIndexCategoryInfo")
    public RetVal getIndexCategoryInfo();

    //通过品牌的id获取品牌的信息  用于远程调用 展示商品上架信息
    @GetMapping("/product/brand/getBrandById/{brandId}")
    public BaseBrand getBrandById(@PathVariable Long brandId);

    //根据skuId获取平台属性
    @GetMapping("/product/getPlatformPropertyBySkuId/{skuId}")
    public List<PlatformPropertyKey> getPlatformPropertyBySkuId(@PathVariable Long skuId);
}
